package com.xzx.mybatis;

/**
 * @author xinzhixuan
 * @version 1.0
 * @date 2025/6/29 22:56
 */
public enum Status {
    ONLINE(200, "在线"), OFFLINE(404, "离线");

    private final int code;

    Status(int code, String desc) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static Status getEnum(int code) {
        for (Status value : Status.values()) {
            if (value.code == code) {
                return value;
            }
        }
        return null;
    }
}
